

/*选择排序算法*/

void select_sort(ElemType *array,int arr_size)
{
	int i = 0;
	int j;
	ElemType temp = 0;
	int min_index;
	
	for(i; i < arr_size - 1;i++)
	{
		min_index = i;
		for(j = i+1; j < arr_size; j++)
		{
			if(array[min_index] > array[j])
			{
				min_index = j;
			}
		}
		
		if(min_index != i)
		{
			temp = array[min_index];
			array[min_index] = array[i];
			array[i] = temp;
		}
	}
}